<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%><%@include file="/include/public.jspf"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/m-base.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/m-common.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/p-all.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/member.css" />
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="${path }/js/jquery1.10.2.min.js"></script>
<script type="text/javascript" src="${path }/js/morepaging-rebate.js"></script><!-- 分页数据拼接 -->
<script type="text/javascript" src="${path }/js/helper.js"></script>
<script type="text/javascript" src="${path }/js/common/base.js"></script>
<script type="text/javascript">
wx.config({
	   debug:  false,  //调式模式，设置为ture后会直接在网页上弹出调试信息，用于排查问题
	   appId: '${appId}',
	   timestamp: ${timestamp},
	   nonceStr: '${nonceStr}',
	   signature: '${signature}',
	   jsApiList: [  //需要使用的网页服务接口
	       'checkJsApi',  //判断当前客户端版本是否支持指定JS接口
	       'onMenuShareTimeline', //分享给好友
	       'onMenuShareAppMessage', //分享到朋友圈
	       'onMenuShareQQ',  //分享到QQ
	       'onMenuShareWeibo', //分享到微博
	       'showAllNonBaseMenuItem'
	   ]
	 });
	 
wx.ready(function () {   //ready函数用于调用API，如果你的网页在加载后就需要自定义分享和回调功能，需要在此调用分享函数。//如果是微信游戏结束后，需要点击按钮触发得到分值后分享，这里就不需要调用API了，可以在按钮上绑定事件直接调用。因此，微信游戏由于大多需要用户先触发获取分值，此处请不要填写如下所示的分享API
	 // 1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
	     wx.onMenuShareAppMessage({
	      title: '红包红包4000万，看谁抢先谁手快？',
		  desc: '戳一戳，点一点，魔环下起“红包雨”！',
	      link: '${h5domain}/goregister.htm?un=${recommendCode }',
	      imgUrl: '${h5domain}/images/yqhy.jpg',
	      success: function (res) {
	        alert('已分享');
	        window.location.href="${h5domain}/rebate/listpage.htm";
	      },
	      /* cancel: function (res) {
	        alert('已取消');
	      }, */
	      fail: function (res) {
	        alert(JSON.stringify(res));
	      }
	    });
	    
   //2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
	    wx.onMenuShareTimeline({
	      title: '红包红包4000万，看谁抢先谁手快？',
	      link: '${h5domain}/goregister.htm?un=${recommendCode }',
	      imgUrl: '${h5domain}/images/yqhy.jpg',
	      success: function (res) {
	    	  alert('已分享');
	      window.location.href="${h5domain}/rebate/listpage.htm";
	      },
	      fail: function (res) {
	        alert(JSON.stringify(res));
	      }
	    });
	    wx.showAllNonBaseMenuItem();
});

wx.error(function (res) {
	 alert(res.errMsg);  //打印错误消息。及把 debug:false,设置为debug:ture就可以直接在网页上看到弹出的错误提示
});
</script>
<title>我的返利</title>
<style type="text/css">
/*分享*/
.mask_fx{position:fixed;text-align:right;bottom:0;left:0;right:0;width:100%;height:100%;background:rgba(0,0,0,0.6);background:#000\9;/*CSS Hack,只能对ie9以下浏览器ie6,ie7,ie8有效，否侧ie10,FF,Cherome会失去透明效果*/filter:Alpha(opacity=90);/*只对ie7,ie8有效*/z-index:2588; }
.mask_fx img{width:90%}
</style>
</head>
<body>
	<div class="ui_title">
		<a class="ui_back" href="${path }/member/center.htm"><i class="ui_icon_back"></i>返回</a>
		我的返利
	</div>
	<section class="m-main p_account_invitation p_load">
		<%--         <div class="banner">
            <img src="${path }/images/inv_banner.jpg" width="100%">
        </div> --%>
		<div class="inv_data clearfix">
			<div>
				<p>邀请人数(人)</p>
				<span class="f15"><fmt:formatNumber value="${inviteCount}" pattern="0"></fmt:formatNumber> </span>
			</div>
			<div>
				<p>已返金额(元)</p>
				<span class="f15"><fmt:formatNumber value="${paidMoney/100 }" pattern="0.00"></fmt:formatNumber> </span>
			</div>
			<div>
				<p>待返金额(元)</p>
				<span class="f15"><fmt:formatNumber value="${unpayMoney/100 }" pattern="0.00"></fmt:formatNumber></span>
			</div>
		</div>
		<div class="inv_share">
			<!-- 循环 -->
			<div class="i-list">
				<dl>
					<dt>
						<h3>您的邀请码：${recommendCode }</h3>
						<h4>
							好友使用邀请码注册/投资<br />您可获0.5%的返利
						</h4>
					</dt>
					<dd>
						<input id="inviteBtn" class="inv-btn" type="button" value="邀请">
					</dd>
				</dl>
			</div>
		</div>

		<div class="tab_list" id="list_more"></div>

		<div class="ui_loadmore_text">
		<input type="hidden" value="" id="pagenumber">
			<a href="javascript:void(0);" class="more">点击加载更多</a>
		</div>
	</section>
	<div class="mask_fx" style="display:none">
	<img src="${path }/page/shareredpacket/images/guide1.png" />
</div>
	<script type="text/javascript">
	//加载更多--分页
	    	var isLogin = ${isLogin};
	    	if(!isLogin){
	    		window.location.href="${path }/user/login/index.jsp";
	    	}
	        // 加载更多事件绑定
	        var page = 2;
	        $(document).on('click','.more',function(){
	            reqData(page, '#list_more');
	            page++;
	        });
	     	// ajax请求
			function reqData(page, pageSelector) {
				$('.ui_loadmore_text').html('<div class="ui_loading"><div class="bar1"></div><div class="bar2"></div><div class="bar3"></div><div class="bar4"></div><div class="bar5"></div><div class="bar6"></div><div class="bar7"></div><div class="bar8"></div><div class="bar9"></div><div class="bar10"></div><div class="bar11"></div><div class="bar12"></div></div>&nbsp;&nbsp;正在加载');
				$.ajax({
					url : '${path }/rebate/list.htm',
					type : 'post',
					data : {
						curPage : page,
					},
					success : function(data) {
						data = $.parseJSON(data);
						addHtml(data);
						if (data.pageCount[0] <= 0) {
							$(pageSelector).hide();
							return;
						} else {
							$(pageSelector).show();
						}
					},
					error : function() {
					}
				})
			}
			// 初始数据
	        reqData(1,'#list_more');
			//点击邀请
			$("#inviteBtn").click(function(){
				$(".mask_fx").show(100);
			});
	</script>
</body>
</html>